<template>
  <div class=''>
    <el-dialog :model-value="props.sendImportDlg" :show-close="true" title="站内信" width="40%" :before-close="closeDlg">
      <el-form :model="sendTableData" label-width="120px">
        <el-form-item label="标题：">
          <el-input v-model="sendTableData.title" />
        </el-form-item>
        <el-form-item label="内容：">
          <el-input v-model="sendTableData.note" type="textarea" />
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="closeDlg">取消</el-button>
          <el-button type="primary" @click="submit">
            确定
          </el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue"
import { ElMessage, ElMessageBox } from 'element-plus'
const props = defineProps(["sendImportDlg"])
const emits = defineEmits()
const sendTableData = ref({
  title: "",
  note: ""
})

const closeDlg = () => {
  sendTableData.value.note = ""
  sendTableData.value.title = ""
  emits("closeSendDlg")
}
const submit = () => {
  // console.log(txtValue.value, route.query.id, props.status);
  ElMessageBox.confirm(
    '您确定要发送站内信吗？',
    '发送提示',
    {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
    }
  )
    .then(() => {
      ElMessage.success("发送成功")
      closeDlg()
    })
    .catch(() => {
      ElMessage.success("您已取消发送站内信")
    })
}
</script>

<style lang="less" scoped></style>